package com.qst.mapreduce.wordcount.diliuzhang.zuoye.dierjie;


import org.apache.hadoop.io.LongWritable;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.Mapper;

import java.io.IOException;

public class AppMapper extends Mapper<LongWritable, Text, Text, App> {
    @Override
    protected void map(LongWritable key, Text value, Mapper<LongWritable, Text, Text, App>.Context context) throws IOException, InterruptedException {
        String line=value.toString();
        // /t 制表符 分割
        String[] words=line.split(",");
        App App=new App();
        //Text outkey=new Text(words[2]);
        App.setCount(Integer.parseInt(words[3]));
        App.setTime(Integer.parseInt(words[4]));
        App.setConsume(Integer.parseInt(words[5]));

        context.write(new Text(words[2]), App);



    }
}